package com.jie.jie.xiaohua.ui;

import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

import com.jaydenxiao.common.base.BaseActivity;
import com.jie.jie.R;

import butterknife.Bind;
import butterknife.OnClick;

public class XiaohuaActivity extends BaseActivity {


    @Bind(R.id.back_iv)
    ImageView backIv;
    @Bind(R.id.title_tv)
    TextView titleTv;
    @Bind(R.id.xiaohua_fl)
    FrameLayout xiaohuaFl;
    @Bind(R.id.rb_con)
    RadioButton rbCon;
    @Bind(R.id.rb_img)
    RadioButton rbImg;
    @Bind(R.id.xiaohua_rg)
    RadioGroup xiaohuaRg;
    @Bind(R.id.activity_xiaohua)
    LinearLayout activityXiaohua;
    private Fragment conFrag, imgFrag;

    @Override
    public int getLayoutId() {
        return R.layout.activity_xiaohua;
    }

    @Override
    public void initPresenter() {

    }

    @Override
    public void initView() {
        conFrag = new ContentFragment();
        imgFrag = new ImgFragment();
        getSupportFragmentManager().beginTransaction().replace(R.id.xiaohua_fl, conFrag).commit();
        rbCon.isChecked();
    }




    @OnClick({R.id.back_iv, R.id.rb_con, R.id.rb_img})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back_iv:
                finish();
                break;
            case R.id.rb_con:
                getSupportFragmentManager().beginTransaction().replace(R.id.xiaohua_fl, conFrag).commit();
                rbCon.isChecked();
                titleTv.setText("笑话");
                break;
            case R.id.rb_img:
                getSupportFragmentManager().beginTransaction().replace(R.id.xiaohua_fl, imgFrag).commit();
                rbImg.isChecked();
                titleTv.setText("趣图");
                break;
        }
    }
}
